import requests

'''
    基于本地代理: clash
'''

# 设置请求头参数
headers = {
    'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/130.0.0.0 Safari/537.36 Edg/130.0.0.0'
}

ip = '127.0.0.1'
port = 7890
proxy = {
    'http': f'http://{ip}:{port}',
    'https': f'http://{ip}:{port}'
}

url = 'http://httpbin.org/ip'

response = requests.get(url, headers=headers, proxies=proxy)

print(response.json())

